package interaction.game;

import processing.core.PImage;

public class Animation {
	private PImage[] frames;
	private int currentFrame;
	
	public Animation(PImage[] frames)
	{
		this.frames = frames;
		this.currentFrame = 0;
	}
	
	public PImage getCurrentFrame()
	{
		return frames[currentFrame];
	}
	
	public void update()
	{
		currentFrame++;
		if (currentFrame >= frames.length) {
			currentFrame = 0;
		}
	}
}
